package com.zy.web.demo.duoxiancheng.demo20;

import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/20 14:32
 */
public class Test20 {

    public static void main(String[] args) throws IOException, InterruptedException {
        WriteData writeData = new WriteData();
        ReadData readData = new ReadData();

        PipedInputStream inputStream = new PipedInputStream();
        PipedOutputStream outputStream = new PipedOutputStream();
        outputStream.connect(inputStream);

        ThreadB20 B = new ThreadB20(readData,inputStream);
        B.start();
        Thread.sleep(1000);
        ThreadA20 A = new ThreadA20(writeData,outputStream);
        A.start();



    }

}
